<?php
include "../lib/DAL/DmTonGiao.php";

class DmTonGiaoBLL{
    function __construct(){
    }
    
    function __destruct(){
    }
    
    public function setdmTonGiaoBLL($row){
        $tongiao= new DmTonGiao();
        $tongiao->setdmtongiao($row['madm_tongiao'],$row['ten_tongiao']);
        return $tongiao;
        
    }
    
	
	
    
    public function getlistTonGiao(){
        $sql="SELECT * FROM dm_tongiao";
        $ex=mysql_query($sql);
        if($ex){
            while($row=mysql_fetch_array($ex)){
                $ds[]=$this->setdmTonGiaoBLL($row);
            }
        }
        
        return $ds;
    } 
    
    public function insertTonGiao($tongiao){
        $sql="  INSERT INTO dm_tongiao(madm_tongiao,ten_tongiao) 
                VALUES('".$tongiao->getmadm_tongiao()."','".$tongiao->getten_tongiao()."')";
        
        $kq= mysql_query($sql);
        
        return $kq;
    }
    
}
?>